<!DOCTYPE html>
<html lang="zh_CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style type="text/css">
    .first, .second, .third {
        margin: 30px 20px;
        width: 500px;
        height: 30px;
        border: 2px solid #000;
        border-radius: 5px;
    }
    .ui-slider,
    .ui-progressbar {
        position: relative;
        box-sizing: border-box;
    }
    .ui-slider > span,
    .ui-slider > em {
        position: absolute;
    }
    .ui-slider > em {
        top: -30px;
    }
    .ui-slider > span {
        box-sizing: border-box;
        top: -20%;
        width: 16px;
        height: 140%;
        border: 2px solid #000;
        border-radius: 6px;
        background-color: rgba(139, 69, 19, 0.6);
        cursor: pointer;
    }
    .ui-slider > b {
        position: absolute;
        left: calc(100% + 20px);
        top: calc(50% - 10px);
    }
    .ui-slider > div {
        height: 100%;
        background-color: rgba(0, 255, 0, 1);
        position: absolute;
        top: 0;
        left: 0;
    }
    .ui-progressbar > div {
        height: 100%;
        background-color: rebeccapurple;
    }
    </style>
</head>

<body>
    <div class="first" data-bind="type:'slider', data:demo1"></div>
    <div class="second" data-bind="type:'slider', data:demo2"></div>
    <div class="third" data-bind="type:'progressbar', data:demo3"></div>
    <script type="text/javascript" src="demo01.js"></script>
    <script type="text/javascript">
    var demo1 = {
            position: 60,
            totle: 200
        },
        demo2 = {
            position: 50
        },
        demo3 = {
            position: 60
        };

    window.onload = function() {
        // 渲染组件
        VM();
    }
    </script>
</body>

</html>